home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re Linking & ODF Draw.2 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.0 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Linking & ODF Draw
  2. Sent:        6/3/96 2:46 PM
  3. Received:    6/3/96 3:11 PM
  4. From:        Mary Boetcher, mary_boetcher@quickmail.apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8.         Reply to:   RE>>Linking & ODF Draw
  9.  
  10. >>It appears that the indices are assigned when 
  11. >>the part is internalized from storage, via "PostInternalizeShape", 
  12. >>ditto for the selection. So, if I create a new document, draw some 
  13. >>shapes, save the doc, and reopen it, the shapes will be numbered 
  14. >>1..n. Then I paste some more shapes, now my doc's shape list is 
  15. >>numbered 1..n, 1..m. Now I select some shapes (including some that I 
  16. >>just pasted in). Let's say I have 8 shapes altogether, numbered 1..5, 
  17. >>1..3, and I select the first, third and last shape. When I copy, the 
  18. >>selection is externalized with the shape indices of 1, 3 & 3.
  19. Actually the selection is externalized with the shape indices of 1, 2 & 3, because the index is reset in CDrawContent::ExternalizeShapeList. However, I see a potential problem when this selection is internalized. If the part's existing shapes are numbered 1..n, then CDrawPart::FindShapeWithIndex may return the wrong shape. I will investigate this further.
  20.  
  21. >>what really 
  22. >>confuses me is that ODF Draw uses the same content base class for 
  23. >>both its part storage as well as its selection, but in my case (and 
  24. >>maybe others as well) that is not a workable model. It also makes the 
  25. >>code harder to understand since when one is in some overriddem member 
  26. >>function, it isn't obvious which shape list is being used.
  27. The reason the same content base class is used for both part and selection storage is simply that the content is kept in the same form (a shape list) and many operations are the same (AddShape, IsEmpty). Other samples, such as ODFTable, use separate subclasses of FW_CContent for the part content and selection content.
  28.  
  29. Hope this helps,
  30.  
  31. Mary Boetcher
  32. ODF Person
  33.